﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mang
{
    public class HocSinh : IComparable
    {
        int iD;

        public int ID
        {
            get { return iD; }
            set { iD = value; }
        }
        string hoTen;

        public string HoTen
        {
            get { return hoTen; }
            set { hoTen = value; }
        }
        float diemTB;

        public float DiemTB
        {
            get { return diemTB; }
            set { diemTB = value; }
        }

        public HocSinh(int id, string hoten, float diem)
        {
            ID = id;
            HoTen = hoten;
            DiemTB = diem;
        }

        public override string ToString()
        {
            return iD + " - " + hoTen + " - " + diemTB;
        }

        public int CompareTo(object other)
        {
            HocSinh p = other as HocSinh;
            float a = this.DiemTB;
            float b = p.DiemTB;
            int value = a.CompareTo(b);
            return value;
        }
    }
}
